<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/5/15
  Time: 15:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <title>CT表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<div class="chaCt-body">
    <div class="chaCt-host"><%--主页--%>
        <%
            //获取项目的根路径
            String path = request.getContextPath();
            String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
        %>
        <%--导入layui的css样式--%>
        <link rel="stylesheet" href="<%=basePath%>layui-v2.6.5/layui/css/layui.css" media="all">
        <link rel="stylesheet" href="<%=basePath%>depa/css/chaCt.css">
        <div class="chaCt-search"><%--搜索框条件--%>
            <form class="layui-form" action="<%=basePath%>ChaCtServlet" method="post">
                诊断号:<input type="text" name="id" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                用户姓名:<input type="text" name="name" class="">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">查询</button>
            </form>
        </div>
        <div class="chaCt-centre"><%--显示数据--%>
            <table class="layui-table" lay-even lay-skin="row" lay-size="lg">
                <colgroup>
                    <col width="150">
                    <col width="200">
                    <col>
                </colgroup>
                <thead>
                <tr class="centre-tr">
                    <td>诊断号</td>
                    <td>用户姓名</td>
                    <td>检查时间</td>
                    <td>检查补位</td>
                    <td>检查结果</td>
                    <td>检查医生</td>
                </tr>
                </thead>
                <tbody>
                <c:choose>
                    <c:when test="${requestScope.page.list.size()>0}">
                        <c:forEach items="${page.list}" var="ctPage">
                            <tr class="centre-tr1">
                                <td>${ctPage.id}</td>
                                <td>${ctPage.name}</td>
                                <td>${ctPage.cTime}</td>
                                <td>${ctPage.inspectionItem}</td>
                                <td>${ctPage.diagnose}</td>
                                <td>${ctPage.doctorname}</td>
                            </tr>
                        </c:forEach>
                    </c:when>
                    <c:otherwise>
                        <h2 class="cneter-h2">没有相关数据</h2>
                    </c:otherwise>
                </c:choose>

                </tbody>
            </table>
        </div>
        <%--显示结束--%>
        <div class="chaCt-base"><%--页面上下页--%>
            <%--设置首页--%>
            <a href="<%=basePath%>ChaCtServlet?currentPage=1&id=${id}&name=${name}">首页</a>
            <c:if test="${page.currentPage>1}">
                <a href="<%=basePath%>ChaCtServlet?currentPage=${page.currentPage-1}&id=${id}&name=${name}">上一页</a>
            </c:if>
            ${page.currentPage}/${page.totalPage}
            <c:if test="${page.currentPage<page.totalPage}">
                <a href="<%=basePath%>ChaCtServlet?currentPage=${page.currentPage+1}&id=${id}&name=${name}">下一页</a>
            </c:if>
            <%--设置尾页--%>
            <a href="<%=basePath%>ChaCtServlet?currentPage=${page.totalPage}&id=${id}&name=${name}">尾页</a>
        </div>
        <%--页面上下页--%>
    </div>
</div>
<script type="text/javascript" src="<%=basePath%>depa/js/jquery-1.12.4.js"></script>
</body>
</html>
